package converter.test.demo.controller;

import org.noear.solon.annotation.Controller;
import org.noear.solon.annotation.Mapping;
import converter.test.demo.entiy.UserMember;

import java.util.ArrayList;
import java.util.HashMap;

@Controller
@Mapping("/")
public class SolonTestController {

    public static Object testData(){
        UserMember userMember = new UserMember();

        UserMember userMember2 = new UserMember();
        userMember.setMember(userMember2);
        HashMap<String, UserMember> hashMap = new HashMap<>();
        hashMap.put("w9",userMember2);
        userMember.setMemberMaps(hashMap);
        userMember.setMemberObjMap(new HashMap<>(hashMap));
        userMember.setMemberObjArr(new Object[]{userMember2});
        ArrayList arrayList = new ArrayList<>();
        arrayList.add(userMember2);
        userMember.setMemberObjs(arrayList);
        return  userMember;
    }

    @Mapping("/")
    public Object test(){
        return  testData();
    }
}
